import { Alert, Container, Paper, Text } from "@mantine/core"
import { IconAlertSquareRoundedFilled } from "@tabler/icons-preact"
import { ErrorProps } from "../../props/Props"

export default function Error(props?: ErrorProps) {

	const icon = props?.icon ?? <IconAlertSquareRoundedFilled />

	return (
		<Container>
			<Paper shadow="xl" p="xs">
				<Alert variant="light" color={props?.color} title="Ooops..." icon={icon}>
					<Text>{props?.title}</Text>
					<Text>{props?.description}</Text>
				</Alert>
			</Paper>
		</Container>
	)
}
